/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file sleepCatcher.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef _SLEEPCATCHER_H_
#define _SLEEPCATCHER_H_

#include <FBase.h>
#include <FSystem.h>
#include <FApp.h>
#include <FUi.h>
#include <FUix.h>

#include "SCDatabase.h"
#include "SCDataCollector.h"
#include "SCFormManager.h"

using namespace Osp::Uix;
using namespace Osp::App;
using namespace Osp::Base;
using namespace Osp::System;
using namespace Osp::Ui;
using namespace Osp::Ui::Controls;

/**
 * [sleepCatcher] application must inherit from Application class
 * which provides basic features necessary to define an application.
 */
class SleepCatcher :
	public Osp::App::Application,
	public Osp::System::IScreenEventListener
{


// Constructor
public:
	SleepCatcher();
	~SleepCatcher();

//Attributes
	SCFormManager *pSCFormManager;
	Osp::Ui::Controls::Frame *pFrame;

// Methods
public:
	/**
	 * [sleepCatcher] application must have a factory method that creates an instance of itself.
	 */
	static Osp::App::Application* CreateInstance(void);

	// Called when the application is initializing.
	bool OnAppInitializing(Osp::App::AppRegistry& appRegistry);

	// Called when the application is terminating.
	bool OnAppTerminating(Osp::App::AppRegistry& appRegistry, bool forcedTermination = false);


	// Called when the application's frame moves to the top of the screen.
	void OnForeground(void);


	// Called when this application's frame is moved from top of the screen to the background.
	void OnBackground(void);

	// Called when the system memory is not sufficient to run the application any further.
	void OnLowMemory(void);

	// Called when the battery level changes.
	void OnBatteryLevelChanged(Osp::System::BatteryLevel batteryLevel);

	// Called when the screen turns on.
	void OnScreenOn (void);

	// Called when the screen turns off.
	void OnScreenOff (void);

	//void OnDataReceived (SensorType sensorType, SensorData &sensorData, result r);
};

#endif
